package com.issac.security.service;

import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;

@Service
public class MethodService {

    @Secured({"ROLE_admin"})
    public String admin(){
        return "hello admin";
    }
    @PreAuthorize("hasAnyRole('user')")
    public String user(){
        return "hello user";
    }
    @Secured({"ROLE_admin","ROLE_user"})
    public String hello(){
        return "hello hello";
    }
    public String hello4(){
        return "hello hello5555";
    }

}
